// vite.config.ts
import { defineConfig, loadEnv } from "file:///E:/AA-project/vue_ts/node_modules/.pnpm/vite@5.0.10_@types+node@18.19.3_sass@1.69.5/node_modules/vite/dist/node/index.js";
import vue from "file:///E:/AA-project/vue_ts/node_modules/.pnpm/@vitejs+plugin-vue@4.5.2_vite@5.0.10_vue@3.3.12/node_modules/@vitejs/plugin-vue/dist/index.mjs";
import path from "path";
import { createSvgIconsPlugin } from "file:///E:/AA-project/vue_ts/node_modules/.pnpm/vite-plugin-svg-icons@2.0.1_vite@5.0.10/node_modules/vite-plugin-svg-icons/dist/index.mjs";
import { viteMockServe } from "file:///E:/AA-project/vue_ts/node_modules/.pnpm/vite-plugin-mock@2.9.6_mockjs@1.1.0_rollup@2.79.1_vite@5.0.10/node_modules/vite-plugin-mock/dist/index.js";
import postCssPxToRem from "file:///E:/AA-project/vue_ts/node_modules/.pnpm/postcss-pxtorem@6.1.0_postcss@8.4.32/node_modules/postcss-pxtorem/index.js";
var vite_config_default = defineConfig(({ command, mode }) => {
  let env = loadEnv(mode, process.cwd());
  return {
    plugins: [
      vue(),
      createSvgIconsPlugin({
        iconDirs: [path.resolve(process.cwd(), "src/assets/icons")],
        symbolId: "icon-[dir]-[name]"
      }),
      viteMockServe({
        mockPath: "mock",
        localEnabled: command === "serve"
        //保证开发阶段可以使用mock接口
      })
    ],
    resolve: {
      alias: {
        "@": path.resolve("./src")
        // 相对路径别名配置，使用@代替src
      }
    },
    //scss全局变量的配置
    css: {
      preprocessorOptions: {
        scss: {
          javascriptEnabled: true,
          additionalData: '@import "./src/styles/variable.scss";'
        }
      },
      postcss: {
        plugins: [
          postCssPxToRem({
            // 自适应px,rem转换 设计稿宽度/10 1920/10=192
            rootValue: 192,
            //  需要置换的属性，这里全部置换
            propList: ["*"],
            //  白名单,过滤掉norem开头的class,不转换rem
            selectorBlackList: ["norem"]
          })
        ]
      },
      // 代理跨域
      server: {
        proxy: {
          [env.VITE_APP_BASE_API]: {
            // 获取数据的服务器地址设置
            target: env.VITE_SERVE,
            // 是否代理跨域
            changeOrigin: true,
            // 路径重写
            rewrite: (path2) => path2.replace(/^\/api/, "")
          }
        }
      }
    }
  };
});
export {
  vite_config_default as default
};
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsidml0ZS5jb25maWcudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbImNvbnN0IF9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9kaXJuYW1lID0gXCJFOlxcXFxBQS1wcm9qZWN0XFxcXHZ1ZV90c1wiO2NvbnN0IF9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9maWxlbmFtZSA9IFwiRTpcXFxcQUEtcHJvamVjdFxcXFx2dWVfdHNcXFxcdml0ZS5jb25maWcudHNcIjtjb25zdCBfX3ZpdGVfaW5qZWN0ZWRfb3JpZ2luYWxfaW1wb3J0X21ldGFfdXJsID0gXCJmaWxlOi8vL0U6L0FBLXByb2plY3QvdnVlX3RzL3ZpdGUuY29uZmlnLnRzXCI7aW1wb3J0IHsgZGVmaW5lQ29uZmlnLCBsb2FkRW52IH0gZnJvbSAndml0ZSdcclxuaW1wb3J0IHZ1ZSBmcm9tICdAdml0ZWpzL3BsdWdpbi12dWUnXHJcbmltcG9ydCBwYXRoIGZyb20gJ3BhdGgnXHJcbi8vIFx1NUYxNVx1NzUyOHN2Z1x1OTcwMFx1ODk4MVx1NzUyOFx1NTIzMFx1NzY4NFx1NjNEMlx1NEVGNlxyXG5pbXBvcnQgeyBjcmVhdGVTdmdJY29uc1BsdWdpbiB9IGZyb20gJ3ZpdGUtcGx1Z2luLXN2Zy1pY29ucydcclxuaW1wb3J0IHsgdml0ZU1vY2tTZXJ2ZSB9IGZyb20gJ3ZpdGUtcGx1Z2luLW1vY2snXHJcbmltcG9ydCBwb3N0Q3NzUHhUb1JlbSBmcm9tICdwb3N0Y3NzLXB4dG9yZW0nXHJcblxyXG4vLyBodHRwczovL3ZpdGVqcy5kZXY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